package com.chdwmp.product.mapper;

import com.chdwmp.product.bean.app.AgentUserReationVo;
import com.chdwmp.product.bean.pay.AliPrePayReqVo;
import com.chdwmp.product.bean.pay.OrderInfoBo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author jinzhiyuan
 * @Description: 注册时购买dao
 * @date 2021-3-9 19:59
 */
@Mapper
public interface TRegisterPayMapper {

    void insertAgentUserReation(AgentUserReationVo vo);

    OrderInfoBo getOrderInfo(String order_code);

    int addPayRecord(@Param("order_type") Integer order_type, @Param("order_code") String order_code, @Param("pay_status") Integer pay_status,
                        @Param("pay_way") Integer pay_way, @Param("pay_money") Integer pay_money,
                        @Param("order_pre_pay_id") String order_pre_pay_id, @Param("order_pay_id") String order_pay_id);

    int updateConsultOrderPayStatus(@Param("order_code") String order_code, @Param("pay_way")Integer pay_way, @Param("pay_money")Integer pay_money);

    int insertPayRecord(@Param("order_type") Integer order_type, @Param("order_code") String order_code, @Param("pay_status") Integer pay_status,
                        @Param("pay_way") Integer pay_way, @Param("pay_money") Integer pay_money,
                        @Param("order_pre_pay_id") String order_pre_pay_id, @Param("order_pay_id") String order_pay_id);

    Integer getAgentIdByOrderCode(String order_code);

    String queryAgentByProduct(String order_code);

    void createOrderCode(AliPrePayReqVo aliPrePayReqVo);

    int queryBuyProductCount(String order_code);

    Integer queryRealtionIsExits(@Param("agent_id") Integer agent_id, @Param("product_id")String product_id);

    void updateReationCount(@Param("agent_id") Integer agent_id, @Param("product_id")String product_id, @Param("current_count") int current_count);

    int queryCount(@Param("agent_id") Integer agent_id, @Param("product_id")String product_id);
}
